package com.cloud.drore.eboss.supplier.mapper.provider;

import com.cloud.drore.eboss.supplier.entity.CombinationProductPrice;

/**
 * 浙江卓锐科技股份有限公司 版权所有  Copyright 2018<br>
 *
 * @Description: <br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/4/10 10:03 <br>
 * @Author: <a href="575842778@qq.com">郑永涛</a>
 */
public class CombinationProductPriceProvider {

    public CombinationProductPriceProvider(){

    }

    private static String selectPriceByParamSql = "select id,combination_product_id,sales_price," +
            " settlement_price,start_time,end_time,product_id " +
            " from eboos_combination_product_price where is_deleted = '0' ";


    public String selectPriceByParam(CombinationProductPrice price){
        String sql = selectPriceByParamSql;
        if(price.getCombinationProductId() !=null )
            sql += " and combination_product_id = " + price.getCombinationProductId() + "";
        if(price.getProductId() != null)
            sql += " and product_id = " + price.getProductId() + "";
        return sql;
    }
}